import GameData from "./GameData";

// Learn TypeScript:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

   

    //最高分
    @property(cc.Label)
    maxscore:cc.Label = null

    //排行view
    @property(cc.Node)
    paihangview:cc.Node = null

    //跳转
    @property(cc.Node)
    tioazhuan:cc.Node = null

    //车库
    @property(cc.Node)
    cheku:cc.Node = null

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {

        this.maxscore.string = GameData.Instance.maxScore.toString()

    }


      
    //点击了开始游戏
    shaichejstartBtnClick() {
        let luogang = 
        {
            "luogang":"哈哈",
            "luogang1":"哈哈",
            "luogang2":"哈哈",
            "luogang3":"哈哈",
            "luogang4":"哈哈",
            "luogang5":"哈哈"
        }
        GameData.Instance.xuanzhuan = false
        GameData.Instance.over = false
        GameData.Instance.huashaichexian = false
        GameData.Instance.onStay = false
        GameData.Instance.onClick = false
        GameData.Instance.guanka = 0
         let self = this
         cc.director.loadScene('Main')
    }



//分享
share()
{
    console.log("点击了分享")
    if(window['wx'])
    {
        window['wx'].shareAppMessage({
            title: GameData.Instance.title,
            imageUrl: GameData.Instance.image
          })
    }
 
}


//打开排行
openpaihang()
{

    this.paihangview.active = true
}


//跳转  
tiaozhuan()
{
    this.tioazhuan.active = true
      
}


//打开车库
opencheku()
{
    this.cheku.active = true
}
    // update (dt) {}
}
